(function(yuxi){
	var render={};
	  var delPower=$("#power-data").attr("data-del");	
	  var souceobject={};
		var fenobject={};
		soucess();
		socePort();
		function soucess()
		{ 
			var url="getAllInfomationSource.do";//渠道地址
			YuXi.util.getAsynCache(url,null,function(data){
				souceobject=data.object;
			
			},function(){});//请求数据
			
			
		}
		function socePort()
		{	var url="getAllInformationPort.do";//分口地址
			
			
			YuXi.util.getAsynCache(url,null,function(data){
				fenobject=data.object;
				//用data循环添加分口信息	
			},function(){});//请求数据
			
		}
		/**flag 列表样式种类：

		1信息管理 待提交的信息

		2信息管理 已提交的信息

		3信息初审 待处理信息

		4信息初审 已处理信息

		5信息研判 待研判的信息***/
	render.InformationSeach=function(object,flag,flow){

		$("#tablebody").html("");
		for(var i=0;i<object.length;i++)
		{
			var pname= object[i].inputPerSonNames;
			pname=pname.substr(1);
			pname=pname.substring(0,pname.length-1);
			object[i].inputPerSonNames=pname;
			//模拟数据
			if( object[i].informationProfile.length>20)			
				object[i].informationProfile= object[i].informationProfile.substring(0,15)+"...";
			var time=YuXi.getTime.get(object[i].createTime);
			object[i].informationSortNames=object[i].informationSortNames.substring(0,4);
			var arrdd =object[i].informationSourceNames.split(",");
					object[i].informationSourceNames=arrdd[0];
			var delDO="";	
		    if(delPower==true||delPower=="true"){
		    	delDO="<a data-id="+object[i].id+" href='javascript:void(0)'; class='user-del-infor'>删除</a>";
		    }else{
		    	delPower="";
		    }
		    //************************************************12.10显示一级*****************02
				var soucename=YuXi.TOPsouce.souce(object[i].informationSourceID,souceobject);
			
				object[i].informationSourceNames=soucename;
				var portname=YuXi.TOPsouce.port(object[i].safetyPortId,fenobject);

				object[i].safetyPortNames=portname;
				//************************************************12.10*****************02
			
			if(flag==1)
			{
				
					var html = "<tr ><td>" + (i+1) + 
					"</td><td >" + object[i].safetyPortNames + "</td>" +
					"</td><td >" + object[i].informationSourceNames + "</td>" +
					"</td><td >" + object[i].informationSortNames + "</td>" +
					"</td><td >" + object[i].informationClassificationNames + "</td>" +
					"</td><td >" + object[i].informationProfile + "</td>" +
					"<td >" + time + "</td><td>" + object[i].flowName + "</td>" +"<td >" + object[i].userName + "</td>"+
					"<td><a data-id=" + object[i].id + 
					" href='javascript:void(0)'; class='detail'>详情</a> <a data-flowId=" + object[i].flowId + " data-id=" + object[i].id + " href='javascript:void(0)'; class='update'>信息管理</a>" +
							" <a data-id=" + object[i].id + " href='javascript:void(0)'; class='submitInfo'>提交</a> </td></tr>";
				
				$("#tablebody").append(html);
			}
			//详情
			else if(flag==2)
			{

				var html = "<tr ><td>" + (i+1)+ "</td>" +
					"</td><td >" + object[i].safetyPortNames + "</td>" +
					"</td><td >" + object[i].informationSourceNames + "</td>" +
					"</td><td >" + object[i].informationSortNames + "</td>" +
					"</td><td >" + object[i].informationClassificationNames + "</td>" +
					"</td><td >" + object[i].informationProfile + "</td>" +
					"<td >" + time + "</td><td>" + object[i].flowName + "</td><td>" + object[i].userName + "</td>"+
					"<td><a data-id=" + object[i].id + " href='javascript:void(0)'; class='detail'>详情</a></td></tr>";
					$("#tablebody").append(html);
			
			}
			//input+详情+flow  初审
			else if(flag==3)
			{
				var html="<tr><td><input data-index='"+(i+1)+"' value="+object[i].id+" type='checkbox' name='together' data-id="+object[i].id+" >  "+(i+1)+"</td>"+
				"<td >" + object[i].safetyPortNames + "</td>" +
						"<td >" + object[i].informationSourceNames + "</td>" +
						"<td >" + object[i].informationSortNames + "</td>" +
						"<td >" + object[i].informationClassificationNames + "</td>" +
						"<td >" + object[i].informationProfile + "</td>"
						 +"<td >"+time+"</td>"+
						 "<td >"+object[i].flowName+"</td>"+ "<td>" + object[i].userName + "</td>"+
				"<td><a href='#' data-id='"+object[i].id+"' class='detail'>详情</a> &nbsp;&nbsp;<a data-flowId=" + object[i].flowId + " data-id="+object[i].id+" href='javascript:void(0);' class='update'>"+flow+"</a> </td></tr>";
				$("#tablebody").append(html);
			}
			//input+详情
			else if(flag==4)
			{

				var html="<tr ><td data-id='"+object[i].id+"'><input value='"+object[i].id+"' type='checkbox' name='idArray' class='check-info'/> "+(i+1)+"</td>"+
				"<td >" + object[i].safetyPortNames + "</td>" +
						"<td >" + object[i].informationSourceNames + "</td>" +
						"<td >" + object[i].informationSortNames + "</td>" +
						"<td >" + object[i].informationClassificationNames + "</td>" +
						"<td >" + object[i].informationProfile + "</td>" +
				"<td >"+time+"</td>"+
				"<td >"+object[i].flowName+"</td> <td>" + object[i].userName + "</td><td><a data-id="+object[i].id+" href='javascript:void(0)'; class='dealDetail detail'>详情</a></td></tr>";
				$("#tablebody").append(html);	
			
			}
			//详情+flow
			else if(flag==5)
			{

				var html="<tr><td> "+(i+1)+"</td>"+
		"<td >" + object[i].safetyPortNames + "</td>" +
				"<td >" + object[i].informationSourceNames + "</td>" +
				"<td >" + object[i].informationSortNames + "</td>" +
				"<td >" + object[i].informationClassificationNames + "</td>" +
				"<td >" + object[i].informationProfile + "</td>"
				 +"<td >"+time+"</td>"+
				 "<td >"+object[i].flowName+"</td>"+ "<td>" + object[i].userName + "</td>"+
		"<td><a class='detail' data-id='"+object[i].id+"'>详情</a>&nbsp<a data-flowId=" + object[i].flowId + " data-id="+object[i].id+" href='javascript:void(0);' class='update'>"+flow+"</a></td></tr>";
				
				$("#tablebody").append(html);
			}
			//input+详情+flow
			else if(flag==6)
			{


			var html='<tr><td><input value="'+object[i].id+'" type="checkbox" name="idArray" class="check-info"/>  '+(i+1)+'</td>'+
				"<td >" + object[i].safetyPortNames + "</td>" +
				"<td >" + object[i].informationSourceNames + "</td>" +
				"<td >" + object[i].informationSortNames + "</td>" +
				"<td >" + object[i].informationClassificationNames + "</td>" +
				"<td >" + object[i].informationProfile + "</td>"
				 +"<td >"+time+"</td>"+
				 "<td >"+object[i].flowName+"</td>"+ "<td>" + object[i].userName + "</td>"+
					'<td>' +
					'<div class="btn-group"><a href="javascript:void(0)" class="detail " data-id="'+object[i].id+'" >详情</a>&nbsp;&nbsp;<a href="javascript:void(0)" class="update" data-id="'+object[i].id+'" >信息研判</a></div>' +
					'</td>' +
					'</tr>';
					$("#tablebody").append(html);
			}
			else if(flag==7)
			{
					var html="<tr ><td data-id='"+object[i].id+"'><input value='"+object[i].id+"' type='checkbox' name='idArray' class='check-info'/> "+(i+1)+"</td>"+
		"<td >" + object[i].safetyPortNames + "</td>" +
				"<td >" + object[i].informationSourceNames + "</td>" +
				"<td >" + object[i].informationSortNames + "</td>" +
				"<td >" + object[i].informationClassificationNames + "</td>" +
				"<td >" + object[i].informationProfile + "</td>"
				 +"<td >"+time+"</td>"+
				 "<td >"+object[i].flowName+"</td>"+"<td>" + object[i].userName + "</td>"+
		"<td><a data-id="+object[i].id+" href='javascript:void(0)'; class='dealDetail'>详情</a>" +
				"  &nbsp&nbsp<a data-id="+object[i].id+" href='javascript:void(0)'; class='dealDetail-deploy'>调配 </a>"+delDO+"</td></tr>";
		
				$("#tablebody").append(html);
				
			}
			else if(flag==8)
			{

				var time=YuXi.getTime.get(object[i].zeRenTime*1);
				if(time.indexOf("2080-12-31")>-1)
				{
					time="长期";
				}
				var remark=object[i].remark;
				if(remark==undefined||remark==null){
					remark="";
				}
				object[i].zeRenPerSonNames=object[i].zeRenPerSonNames.substring(1,object[i].zeRenPerSonNames.length);
				object[i].zeRenPerSonNames=object[i].zeRenPerSonNames.substring(0,object[i].zeRenPerSonNames.length-1);
				var x=object[i].zeRenPerSonNames.split(",");
				object[i].zeRenPerSonNames=x[0];
				var html="<tr ><td>"+(i+1)+"</td>"+
			"<td >" + object[i].safetyPortNames + "</td>" +
				"<td >" + object[i].informationSourceNames + "</td>" +
				"<td >" + object[i].informationSortNames + "</td>" +
				"<td >" + object[i].informationClassificationNames + "</td>" +
				"<td >" + object[i].informationProfile + "</td>"
				 +"<td >"+time+"</td>"+
				 "<td >"+object[i].zeRenPerSonNames+"</td>"+"<td>" + object[i].userName + "</td>"+
			"<td><a data-id="+object[i].id+" href='javascript:void(0);' class='detail'>详情</a>&nbsp;&nbsp;<a data-id="+object[i].id+" href='javascript:void(0);' data-id='"+object[i].id+"' data-taskid='"+object[i].taskId+"'data-account='"+object[i].informationAccount+"' class='input-task-finsh-context'>录入任务完成情况</a>&nbsp;&nbsp;</td></tr>";
				$("#tablebody").append(html);
			}
			//任务完成情况
			else if(flag==9)
			{
				var time=YuXi.getTime.get(object[i].zeRenTime*1);
				if(time.indexOf("2080-12-31")>-1)
				{
					time="长期";
				}
				var html="<tr ><td>"+(i+1)+"</td>"+
				"<td >" + object[i].safetyPortNames + "</td>" +
					"<td >" + object[i].informationSourceNames + "</td>" +
					"<td >" + object[i].informationSortNames + "</td>" +
					"<td >" + object[i].informationClassificationNames + "</td>" +
					"<td >" + object[i].informationProfile + "</td>"
					 +"<td >"+time+"</td>"+
					 "<td >"+object[i].flowName+"</td>"+"<td>" + object[i].userName + "</td>"+
				"<td><a href='javascript:void(0);' data-id="+object[i].id +" class='detail'>详情</a>&nbsp;&nbsp;</td></tr>";
				
				$("#tablebody").append(html);


			}

			
		}
		YuXi.graded.refresh();
		YuXi.graded.get();
	}
	yuxi.Render=render;
})(window.YuXi);